<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>{{msg}}</h1>

        <ul>
            <li v-for='(item,index)  of  list'>
                {{item.username}}
            </li>
        </ul>
        <ul>
            <li v-for='(item,index)  in  list'>
                {{item.username}}
            </li>
        </ul>
    </div>
    <script src="./vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'vue',
                list:[]
            },
            methods: {
            },
            created() {
                axios.get('http://www.liulongbin.top:3006/api/cmtlist')
                .then(res=>{
                    console.log(res.data)
                    this.list=res.data.data
                })
                .catch(err=>{
                    console.log(err)
                })

            let url= 'https://locally.uieee.com/categories/1/shops'
                axios.get(url,{
                    params:{
                        _page:2,
                        _limit:20
                    }
                }).then(res=>{
                    console.log(res.data)
                })


 

            },




            mounted() {
                //发送请求 

                axios.post('http://www.liulongbin.top:3006/api/addcmt',
                  {username: 11,content:'哈哈哈'}    

                )
                .then(res=>{
                    console.log(res.data)
                })
            },


        });
    </script>
</body>

</html>